package v1

import (
	"gf_blog_admin/internal/model"
	"github.com/gogf/gf/v2/frame/g"
)

type ArticleListReq struct {
	g.Meta `path:"/content/article" method:"get" tags:"content" sm:"文章列表" can:"content.article"`
	model.ArticleListInput
}
type ArticleListRes struct {
	Total int                      `json:"total"`
	Rows  []*model.ArticleListItem `json:"rows"`
}

type ArticleDetailReq struct {
	g.Meta `path:"/content/article/show/{id}" method:"get" tags:"content" sm:"文章详情" can:"content.article.show"`
	Id     uint64 `json:"id" in:"query" v:"required|min:1" dc:"文章id"`
}

type ArticleDetailRes struct {
	*model.ArticleItem
}

type ArticleStoreReq struct {
	g.Meta `path:"/content/article/store" method:"post" tags:"content" sm:"文章添加" can:"content.article.store"`
	model.ArticleFormInput
}

type ArticleStoreRes struct{}

type ArticleUpdateReq struct {
	g.Meta `path:"/content/article/update/{id}" method:"put" tags:"content" sm:"文章更新" can:"content.article.update"`
	Id     uint64 `json:"id" in:"query" v:"required|min:1" dc:"文章id"`
	model.ArticleFormInput
}

type ArticleUpdateRes struct{}

type ArticleDestroyReq struct {
	g.Meta `path:"/content/article/destroy" method:"delete" tags:"content" sm:"文章删除" can:"content.article.destroy"`
	Ids    []uint64 `json:"ids" v:"required|array|max-length:200" dc:"文章id集合"`
}

type ArticleDestroyRes struct{}

type ArticleRecoverReq struct {
	g.Meta `path:"/content/article/recover" method:"put" tags:"content" sm:"文章恢复" can:"content.article.recover"`
	Ids    []uint64 `json:"ids" v:"required|array|max-length:200" dc:"文章id集合"`
}

type ArticleRecoverRes struct{}

type ArticleRemoveReq struct {
	g.Meta `path:"/content/article/remove" method:"delete" tags:"content" sm:"文章彻底删除" can:"content.article.remove"`
	Ids    []uint64 `json:"ids" v:"required|array|max-length:200" dc:"文章id集合"`
}

type ArticleRemoveRes struct{}
